import request from '@/utils/request'

//请求学生列表
export function getStudentList(query){
  return request({
    url:'/system/student/list',
    method:'get',
    params:query,
    headers: {timeout: 60000}
  })
}


//学生导入

export function uploadsutList(){
  return request({
    url:'/student/upload',
    method:'post'
  })
}

//新增学生
export function addStu(data){
  return request({
    url:'/system/student/add',
    method:'post',
    data: data
  })
}
//更新学生信息
export function changeStu(data){
  return request({
    url:'/system/student/edit',
    method:'post',
    data:data
  })
}
//删除学生
export function deleteStu(id){
  return request({
    url:'/system/student/remove',
    method:'delete',
    data:id
  })
}
//查找学生信息
export function findStudentInfo(id){
  return request({
    url:'/system/student/'+id,
    method:'get',
  })
}
//更新日常反馈信息
export function updataFeedback(data){
  return request({
    url:'/system/feedback/add',
    method:'post',
    data:data
  })
}

//日常反馈
export function dailyback(studentId){
  return request({
    url:'/system/feedback/list/'+studentId,
    method:'get',
  })
}

//测评模块
export function evaluationHistory(query){
  return request({
    url:'/student/evaluationhistory',
    method:'get',
    params:query
  })
}

//导入文件
export function importStu(file){
  let data = new FormData()
  data.append('file',file)
  return request({
    url:'/system/student/import',
    method:'post',
    data:data
  })
}
/* 修改学生密码 */
export function stuResetPwdApi(id){
  return request({
    url:`/system/student/resetPwd?studentId=${id}`,
    method:'post',
  })
}
/* 老师添加建议 */
export function teacherSuggestionsApi(data){
  return request({
    url: '/addTeacherSuggest',
    method: 'post',
    data
  })
}
/* 老师设置学生禁用状态 */
export function teacherSetDisableState(data){
  return request({
    url: '/student/forbidden/create',
    method: 'post',
    data
  })
}
/* 取消学生禁用状态 */
export function cancelDisableState(data){
  return request({
    url: '/student/forbidden/cancel',
    method: 'put',
    data
  })
}

//请求班级列表
export function classList(query){
  return request({
    url:'/student/class/list',
    method:'get',
    params:query
  })
}
//请求学院列表
export function collegeList(){
  return request({
    url:'/system/dept/list',
    method:'get'
  })
}
export function leadstu(data){
  return request({
    url:'/system/student/partExport',
    method:'post',
    data:data,
    responseType:'blob'
  })
}
export function leadAll(){
  return request({
    url:'/system/student/export',
    method:'post',
    responseType:'blob'
  })
}
